package controller

import (
	"context"
	"datum_user/grpc"
	"datum_user/proto"
	"github.com/gin-gonic/gin"
)

func Test(c *gin.Context) {
	tokenService := proto.NewTokenService("datum_common",grpc.GetClientService().Client())
	tokenReq := proto.ParseTokenRequest{Token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MDQwNDM5OTcsInVpZCI6NjQzMjR9.BcE9Pj9TelkbWEQ25YPoTA5nRBbFyf6BC9Hoie41tB0"}
	//tokenReq := proto.GetTokenRequest{Uid: 64324}
	//res,err := tokenService.GetToken(context.Background(),&tokenReq)
	res,err := tokenService.ParseToken(context.Background(),&tokenReq)
	if err != nil {
		ToJson(c,201,err.Error(),nil)
		return
	}
	ToJson(c,200,"ok",res)
}
